Week 12: Midterm II Practice

 

This week's online activity is an online quiz to help you prepare for the second midterm.

 

1.     Complete the online Blackboard Quiz for this activity 


Question 1
Which of the following statements about the Java RMI Registry is false:
	a) The Registry must always be launched from the command line before any distributed application is launched (correct)
	b) The Registry maps service names to remote objects
	c) The Registry binds remote objects to service names
	d) The Registry is accessed through methods of the Naming class

Question 2	
Configuration of Hibernate can be specified by
	a) calls to the RMI Service Registry
	b) serialized Java Objects
	c) retrieving configuration information from a database
	d) using @Config annotations
	e) identifying values in an XML file typically named hibernate.cfg.xml (correct)

Question 3	
Which pairing of words best represents a correspondence in the context of Java Persistence?
	a) Attribute : Row	
	b) Column : Entity
	c) Table : Instance
	d) Class : Column
	e) Entity : Table (correct)

Question 4
JDBC is
	a) an implementation of SQL in Java
	b) an API for Java programs to communicate with databases (correct)
	c) an SQL extension for Java
	d) an implementation of mysql in Java
	e) an acronym for Java Database Byte Code

Question 5
Object-Relational Mapping (ORM) deals with
	a) mapping objects in OOP to relational entities in a database (correct)
	b) mapping methods of client objects to remote stubs on a server
	c) matching stubs of objects on a client to remote objects on a server
	d) matching each attribute of an object to its corresponding row in a database table

Question 6
Which of the following is a false statement about Java Remote Interfaces?
	a) Remote objects implement a remote interface
	b) An RMI stub can be cast to at most one remote interface (correct)
	c) Each method of a remote interface declares java.rmi.RemoteException in its throws clause
	d) A remote interface extends the interface java.rmi.Remote

Question 7
Which of the following is a true statement about Distributed Architecture programs implemented according Java RMI architecture goals:
	a) Clients are concerned with implementing behavior and servers provide the class files for that behavior from a central place
	b) Clients are concerned with definitions of behavior and access a server for an implementation of a defined behavior (correct)
	c) Servers and Clients are together concerned with implementing the behavior of any single remote object
	d) Servers are concerned with definitions of behavior, whereas clients provide implementation accessed by users

Question 8
SQL Injection is an attack on a server based application where an attacker
	a) steals a database userid and password from an application
	b) inserts a back door into an RDBMS
	c) uses stored procedures to steal information from the database
	d) places SQL artifacts into client input fields that the application may use in querying the database (correct)	
	e) bypasses the application to interact with the RDBMS directly

Question 9
In the context of Enterprise Programming, Hibernate is
	a) an implementation of JDBC for Java RMI programs
	b) a Java implementation of SQL
	c) a persistence framework for Java (correct)
	d) a Java extension of mysql
	e) an RDBMS for Java

Question 10
Which of the following cannot be accomplished through the Admin Console of Glassfish (e.g. http://localhost:4848):
	a) Stop the Glassfish server
	b) Deploy applications to the Glassfish server
	c) Start the Glassfish server (correct)
	d) Find available updates to the Glassfish server

Question 11
Both sides of a distributed Java RMI application can act as Server or Client in various operations. Which of the following is not a Server action?
	a) Wait for clients to invoke methods on remote objects
	b) Obtain a remote reference to one or more remote objects (correct)
	c) Make references to remote objects available on the network
	d) Create remote objects

Question 12
Which of the following is true about Remote Object garbage collection
	a) A remote object is garbage collected when the server marks it as "dirty"
	b) There is no such thing, remote objects do not get garbage collected
	c) A remote object is garbage collected after a configurable time period has elapsed
	d) A remote object is garbage collected after all clients have dropped references to it (correct)

Question 13
Remote Method parameters are handled by the Java RMI system in the following way:
	a) Always passed by value (correct)
	b) Parameters are passed in the form of primitive data types
	c) Passed by value for primitive types, by reference for object types
	d) Always passed by reference

Question 14	
Which pairing of words best represents a correpondence in the context of Java Persistence?
	a) Class : Column
	b) Column : Entity
	c) Table : Instance
	d) Attribute : Column (correct)
	e) Object : Class

Question 15	
In Java EE, developers can use Annotations to specify relationships between their Java code and the Application Server
	a) true (correct)
	b) false
	c) true or false: it depends on the type of application
	d) true, but only when a deployment descriptor is in place

Question 16
Classes for remote objects are made available to Client and Server sides of a Distributed Java RMI application through a variety of means, but not in the following way:
	a) Through an ftp server
	b) Through an http server
	c) Locally
	d) Through an smb server (correct)

Question 17	
The role of Hibernate in a Java application with persistence is an
	a) intermediary between Java and JDBC (correct)
	b) alternative for SQL
	c) alternative for an RDBMS
	d) intermediary between JDBC and an RDBMS
	e) alternative for JDBC

Question 18
When a firewall is in operation between the Client and Server sides of a Java RMI application, the following might be a reasonable solution
	a) The RMI Registry might need to be deployed to the other side of the firewall
	b) RMI calls might need to be tunneled through the RMI Registry
	c) RMI calls might need to be tunneled through HTTP (correct)
	d) RMI calls might need to be proxied through the RMI Registry

Question 19
Which of the following is a properly formed RMI URL:
	a) http://example.com/myservice	
	b) rmi://109.78.34.3/myservice (correct)
	c) rmi://1099:example.com/myservice
	d) http://example.com/1099:myservice

Question 20
Which pairing of words best represents a correspondence in the context of Java Persistence?
	a) Entity : Field
	b) Table : Instance
	c) Object : Row (correct)
	d) Column : Entity	
	e) Class : Column

Question 21
In a Java RMI application, a stub is
	a) A remote object	
	b) A proxy for a remote method
	c) A proxy for a remote object (correct)
	d) A remote method

Question 22
The Transport Layer of the Java RMI system performs
	a) Neither basic connectivity nor firewall penetration strategies
	b) Only basic connectivity
	c) Only firewall penetration strategies
	d) Both basic connectivity and firewall penetration strategies (correct)

Question 23	
To implement an RMI server application, the following method call is necessary to make a certain service available on a certain port:
	a) None of these three answers
	b) LocateRegistry.createRegistry()
	c) UnicastRemoteObject.exportObject()
	d) All three of these answers
	e) Naming.rebind() (correct)

Question 24
A Hibernate session factory is used to create Session objects that manage
	a) connection data, caching, and mappings (correct)
	b) credentials for connecting to a database
	c) starting and stopping a database service
	d) the database schema with DDL statements

Question 25
Which of the following statements is true about Java Remote Method Invocation (RMI):
	a) New types and behaviors can be introduced into a remote Java Virtual Machine
	b) It provides the ability to download the definition of an object's class when the class is not defined in the Java Virtual machine
	c) The types and behaviors of an object can be transmitted to another Java Virtual Machine
	d) None of these three answers
	e) All three of these answers (correct)

Question 26	
To implement an RMI client application, the following method call is necessary to bind to an RMI service:
	a) Naming.rebind()
	b) None of these three answers (correct)
	c) All three of these answers
	d) UnicastRemoteObject.exportObject()
	e) LocateRegistry.createRegistry()

Question 27
Which of the following statements is true about a remote object in a Java RMI implementation
	a) It must declare a java.rmi.RemoteException in its constructor (correct)
	b) All three of these answers
	c) Its methods may only take primitive data types as arguments
	d) It must extend the java.rmi.server.UnicastRemoteObject class
	e) None of these three answers

Question 28
In the Context of Web Application Attacks, Cross-Site Scripting (XSS) is a technique where
	a) A user writes a script intended to be run by another user's web server
	b) A user writes a script intended to be run by a website's administrator
	c) A user tricks a server into running a script that was only tested on a different server
	d) A user writes a script intended to be run by another user's web browser (correct)